using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter14
{
	/// <summary>
	/// Example01: The Water Bed
	/// The mattress of a water bed is 2.00 m long by 2.00 m wide 
	/// and 30.0 cm deep.
	/// (A) Find the weight of the water in the mattress.
	/// (B) Find the pressure exerted by the water on the floor 
	/// when the bed rests in its normal position. 
	/// Assume that the entire lower surface of the bed makes 
	/// contact with the floor.
	/// mg = 1.18 \times 10^4 N
	/// P = 2.95 \times 10^3 Pa
	/// </summary>
	public class Example01
	{
		public Example01()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.Volume v = new L.Volume();
			v.mCUBE = 2.0*2.0*0.3;
			L.Density rho = new L.Density();
			rho.kgPERmCUBE = 1000.0;
			L.Mass m = new L.Mass(rho,v);
			L.Weight w = new L.Weight(m);
			result += Convert.ToString(w.N)+"\r\n";
			L.Pressure p = new L.Pressure();
			p.Pa = w.N/(2.0*2.0);
			result += Convert.ToString(p.Pa);
		}
	}
}
